Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

No more formatted_* routes in edge rails

#31

Rails has dropped the formatted_* routes in favor of passing in a :format option, so we need to update the generated tests/specs for Restful Authentication to use this new format.

http://rails.lighthouseapp.com/p... http://github.com/rails/rails/co...

On a fresh install, running off of the latest edge rails (ce706b4b9be03a3f2e7d11438e6550d64c5f4461), three specs fail:

1) NoMethodError in 'UsersController named routing should route user_(:id => '1') to /users/1' undefined method formatted_user_path' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_6::Subclass_3:0x21c3cb4> ./spec/controllers/users_controller_spec.rb:152:

2) NoMethodError in 'UsersController named routing should route new_user_path() to /users/new' undefined method formatted_new_user_path' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_6::Subclass_3:0x21c4510> ./spec/controllers/users_controller_spec.rb:146:

3) NoMethodError in 'UsersController named routing should route users_path() to /users' undefined method formatted_users_path' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_6::Subclass_3:0x21c4c40> ./spec/controllers/users_controller_spec.rb:140:

I'll write the patch here in a sec.

Reported by Trey Bean · January 5th, 2009 @ 04:35 PM

State: new
Milestone: none
Assigned to: mrflip mrflip

Activity

  1. Trey Bean
    Trey Bean

    I created the patch, really tough :)

    I've got a couple of questions, though:

    1) Are there any tests/specs that for the plugin in general? I know most plugins don't have them, but kind of expected them here ;)

    2) How should this handle backwards compatibility? Removing the formatted_ works in edge/2.3, but doesn't work in 2.2?

    Anyway, I'll through my pull request out there, for now. This is one of my first contributions to an open-source project, so feel free to kick me if I'm doing this all wrong.

    http://github.com/treybean/restf...

    January 5th, 2009 @ 05:11 PM

  2. Rick
    Rick

    It generates its tests. Thanks for the patch, but it should really be in a branch for edge rails. There's no way I'm going to break the plugin for some edge change. Edge tends to get new features before adding the deprecations that go into the stable releases.

    January 6th, 2009 @ 06:10 PM

  3. Trey Bean
    Trey Bean

    Ah, I was wondering why that wasn't deprecated in rails 2.2. I guess the deprecation/backwards compatibility will come. Thanks.

    January 6th, 2009 @ 07:25 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.